class CStopWatch
{
public:
    CStopWatch()
    {
        ::QueryPerformanceFrequency(&m_liPerfFreq);
        Start();
    }

    long long NowInMicro()
    {
        LARGE_INTEGER liNow;
        ::QueryPerformanceCounter(&liNow);
        return ((liNow.QuadPart - m_liPerfStart.QuadPart) * 1000000 / m_liPerfFreq.QuadPart);
    }

    long long NowInMilli()
    {
        LARGE_INTEGER liNow;
        ::QueryPerformanceCounter(&liNow);
        return ((liNow.QuadPart - m_liPerfStart.QuadPart) * 1000 / m_liPerfFreq.QuadPart);
    }

private:
    void Start(){::QueryPerformanceCounter(&m_liPerfStart);}

private:
    LARGE_INTEGER m_liPerfFreq;
    LARGE_INTEGER m_liPerfStart;
};